package jp.sourceforge.akjrcp.flvtools.explorer;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.ffmpeg.FFMpegOptions;

import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class ExplorerImageMagickPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {

	public static final String GIF_ANIME_SIZE="explorer.gifanime_size";
	public static final String GIF_ANIME_WAIT="explorer.gifanime_wait";
	public static final String GIF_ANIME_LOOP="explorer.gifanime_loop";
	public static final String IMAGE_LIST_SIZE="explorer.image_list_size";
	public static final String IMAGE_LIST_W="explorer.image_list_w";
	public static final String IMAGE_LIST_H="explorer.image_list_h";
	public ExplorerImageMagickPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("explorer.imagemagick.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		addField(new StringFieldEditor(IMAGE_LIST_SIZE,Messages.getString(IMAGE_LIST_SIZE),getFieldEditorParent())); //$NON-NLS-1$
		
		
		addField(new RadioGroupFieldEditor(
				IMAGE_LIST_W,
				Messages.getString(IMAGE_LIST_W), // //$NON-NLS-1$
				4,
				new String[][] { 
				{ "1", "1" },
				{ "2", "2" },
				{ "3", "3" },
				{ "4", "4" },
				{ "5", "5" },
				{ "6", "6" },
				{ "7", "7" },
				{ "8", "8" },
				{ "9", "9" },
				{ "10", "10" },
				}, getFieldEditorParent()));
		
		addField(new RadioGroupFieldEditor(
				IMAGE_LIST_H,
				Messages.getString(IMAGE_LIST_H), // //$NON-NLS-1$
				4,
				new String[][] { 
				{ "1", "1" },
				{ "2", "2" },
				{ "3", "3" },
				{ "4", "4" },
				{ "5", "5" },
				{ "6", "6" },
				{ "7", "7" },
				{ "8", "8" },
				{ "9", "9" },
				{ "10", "10" },
				}, getFieldEditorParent()));
		
		//gif width x height
		addField(new StringFieldEditor(GIF_ANIME_SIZE,Messages.getString(GIF_ANIME_SIZE),getFieldEditorParent())); //$NON-NLS-1$
		
		//gif time
		addField(new IntegerFieldEditor(GIF_ANIME_WAIT,Messages.getString(GIF_ANIME_WAIT),getFieldEditorParent())); //$NON-NLS-1$
        
		//gif loop
		addField(new IntegerFieldEditor(GIF_ANIME_LOOP,Messages.getString(GIF_ANIME_LOOP),getFieldEditorParent())); //$NON-NLS-1$
        
	}

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
